package org.veridiandynamics.client.view;

import java.awt.CardLayout;
import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;


import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;


/**
 * @author Talia
 * 
 * The panel where medical history is displayed.
 *
 */
public class MedicalHistoryPanel extends JPanel
{
	private JButton back;
	private CardLayout c1;
	private JPanel basePanel;
	
	/**
	 * Constructor for panel; creates panel. 
	 * 
	 * @param c1
	 * @param basePanel
	 */
	public MedicalHistoryPanel(final CardLayout c1, final JPanel basePanel)
	{
		this.c1 = c1;
		this.basePanel = basePanel;
		MainWindow.welcomeMessage.setText("View Medical History");
		
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		JLabel lblMedicalHistorySample = new JLabel("Medical History Sample:");
		add(lblMedicalHistorySample, "4, 4");
		
		TextArea textArea = new TextArea();
		add(textArea, "4, 8, 1, 10");
		textArea.append("treatment record information should be filled in here");
		JLabel lblDf = new JLabel(" ");
		add(lblDf, "8, 12");
		
		JButton btnBack = new JButton("Back");
		add(btnBack, "6, 18");
		btnBack.addActionListener(new ActionListener() 
		{
			public void actionPerformed(ActionEvent event) 
			{
				c1.first(basePanel);
			}
		});
		
		
		
	}
}
